<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    //提取  变量.match(正则对象) 没提取到打印null
    //g:全局匹配
    //i:不区分大小写
    var ya = 'wo ai chi kao ya'
    var ya1 = '我是我的我自己'
    console.log(ya.match(/i/gi));
    console.log(ya1.match(/我/gi));

    //替换  replace
    console.log(ya.replace(/a/gi,'w'));
    console.log(ya1.replace(/我/gi,'你'));
</script>
</html>